package indigo.errors
{
	import indigo.logger.error;

	/**
	 * The <code>ViewError</code> exception is thrown when a <code>View</code> 
	 * failure occurs. For example, a <code>View</code> tries to registers 
	 * itself for the second time.
	 *
	 */
	public class ViewError extends Error
	{
		/**
		 * Error message which is thrown when View is already registered to the 
		 * ViewLocator
		 */
		public static const VIEW_ALREADY_REGISTERED:String = "View already registered";
		/**
		 * Error message which is thrown when a View is not found by the 
		 * ViewLocator
		 */
		public static const VIEW_NOT_FOUND:String = "View not found";
		/**
		 * Error message which is thrown when a View tries to register itself 
		 * but has no name
		 */
		public static const VIEW_NAME_NOT_FOUND:String = "View has no name";


		/**
		 * Constructor
		 * 
		 */
		public function ViewError( message:*, id:* = 0 )
		{
			super( "" + message, id );
			error( this );
		}
	}
}
